
/*
    SUSAN® - Sole of Unix Save ANything

   Copyright (C) 2016-2019 Skyatlas co. ltd

   
*/
#ifndef BAREOS_STORED_LABEL_H_
#define BAREOS_STORED_LABEL_H_

namespace storagedaemon {

int ReadDevVolumeLabel(DeviceControlRecord* dcr);
void CreateVolumeLabel(Device* dev, const char* VolName, const char* PoolName);

#define ANSI_VOL_LABEL 0
#define ANSI_EOF_LABEL 1
#define ANSI_EOV_LABEL 2

bool WriteAnsiIbmLabels(DeviceControlRecord* dcr,
                        int type,
                        const char* VolName);
int ReadAnsiIbmLabel(DeviceControlRecord* dcr);
bool WriteSessionLabel(DeviceControlRecord* dcr, int label);
void DumpVolumeLabel(Device* dev);
void DumpLabelRecord(Device* dev, DeviceRecord* rec, bool verbose);
bool UnserVolumeLabel(Device* dev, DeviceRecord* rec);
bool UnserSessionLabel(Session_Label* label, DeviceRecord* rec);
bool WriteNewVolumeLabelToDev(DeviceControlRecord* dcr,
                              const char* VolName,
                              const char* PoolName,
                              bool relabel);

} /* namespace storagedaemon */

#endif  // BAREOS_STORED_LABEL_H_
